package com.zmcc.service.impl;

import com.google.gson.Gson;
import com.zmcc.entity.SmsSendTemplate;
import com.zmcc.entity.common.CommonRequest;
import com.zmcc.service.ISmsDifferNetRequest;

public class SmsDifferNetRequestCommericial implements ISmsDifferNetRequest {

    private final static String url = "https://dev.cmccopen.cn/api";

    private static SmsDifferNetRequestCommericial SmsDifferNetRequestCommericial;

    public static synchronized SmsDifferNetRequestCommericial getInstance() {
        if (SmsDifferNetRequestCommericial == null) {
            SmsDifferNetRequestCommericial = new SmsDifferNetRequestCommericial();
        }
        return SmsDifferNetRequestCommericial;
    }

    @Override
    public CommonRequest getSmsSendRequest(SmsSendTemplate template) {
        CommonRequest request = new CommonRequest();
        request.setUrl(url+"/v1"+"/smsother" +"/send");
        request.setBody(new Gson().toJson(template));
        return request;
    }
}
